from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("http://baidu.com")
driver.find_element_by_id('kw').send_keys('bilibili')
time.sleep(3)
driver.find_element_by_xpath('//*[@value="百度一下"]').click()
time.sleep(3)
driver.find_element_by_xpath('//*[@id="1"]/h3/a[1]').click()
time.sleep(3)
driver.quit()